A magnetic sensor circuit generally includes a Hall element outputting an output voltage in proportion to magnetic field intensity, an amplifier amplifying the output voltage of the Hall element, and a comparator comparing the output voltage of the amplifier with a prescribed reference voltage and outputting a result of comparison. Further, the magnetic sensor circuit is adopted to output a binary (high (H) level or low (L) level) signal dependent on whether the magnetic field of the place where the magnetic sensor is arranged is higher or lower than a prescribed reference.
In order to obtain an accurate result of comparison based on the magnetic field intensity, it is necessary to reduce offset signal components involved in the signal output from the amplifier and to curb variation in signals output from the amplifier. Main factors causing the offset signal component include an offset signal component involved in the output voltage of the Hall element (hereinafter referred to as an “element offset voltage”) and an offset signal component existing at an input terminal of the amplifier (hereinafter referred to as an “input offset voltage”). The element offset voltage is mainly generated, for example, by a stress from a package to the body of Hall element. Further, the input offset voltage is mainly generated by variation in characteristics of elements forming an input circuit of the amplifier.
Japanese Patent No. 3315397 (Patent Document 1) discloses a magnetic field sensor that reduces the influence of such offset voltages. Specifically, a Hall element used in a magnetic field sensor is generally formed as a plate of geometrically equivalent shape with respect to four terminals A, B, C and D, as represented by a Hall element 1 shown in FIG. 17. Here, a geometrically equivalent shape means that the shape in the state shown in the figure is the same as the shape when the element is rotated by 90 degrees (rotated so that A-C matches B-D), as in the case of Hall element 1 of square shape shown in the figure. A voltage generated across terminals B-D when a power supply voltage is applied across terminals A-C and the voltage generated across terminals A-C when a power supply voltage is applied across terminals B-D of Hall element 1 as such have effective signal components reflecting the magnetic field intensity of the same phase, and element offset voltages of opposite phases.
At a first timing, a power supply voltage is applied across terminals A-C of Hall element 1 through a switch circuit 2, and the voltage across terminals B-D is input to a voltage amplifier 3. Then, a voltage V1 that is in proportion to a sum of the voltage across terminals B-D and the input offset voltage of voltage amplifier 3 is output from voltage amplifier 3. Further, at this first timing, a switch 5 is closed, so that a capacitor 4 is charged to the voltage V1.
Next, at a second timing, the power supply voltage is applied across terminals B-D of Hall element 1 through switch circuit 2, and the voltage across terminals C-A is input to voltage amplifier 3 to establish polarity opposite to that at the first timing. Then, a voltage V2 that is in proportion to a sum of the voltage across terminals C-A and the input offset voltage of voltage amplifier 3 is output from voltage amplifier 3.
The influence of input offset voltage is the same as at the first timing regardless of the polarity of input voltage, and therefore, output voltage V2 of voltage amplifier 3 comes to be a voltage that is in proportion to the sum of the voltage across terminals C-A having the polarity opposite to that at the first timing and the input offset voltage.
Further, at the second timing, switch 5 is opened, and between output terminals 6 and 7, an inverting output terminal 3a and a non-inverting output terminal 3b of voltage amplifier 3 and a capacitor 4 come to be connected in series. At this time, charging voltage of capacitor 4 is kept unchanged from the output voltage V1 of voltage amplifier 3 at the first timing. A voltage V across output terminals 6-7 (output voltage of magnetic field sensor) is a sum of voltage V2 at non-inverting output terminal 3b with inverting output terminal 3a of voltage amplifier 3 being a reference and a voltage −V1 at a terminal 4a with a terminal 4b of capacitor 4 being a reference, that is, a voltage obtained by subtracting voltage V1 from voltage V2. Therefore, the voltage V that cancels the influence of input offset voltage Voff is obtained as the output voltage of magnetic field sensor.
Further, as a magnetic field sensor that reduces the influence of element offset voltage and that can also reduce the influence of input offset voltage generated in the amplifier, a sensor disclosed in Japanese Patent Laying-Open No. 08-201491 (Patent Document 2) has been known. The magnetic field sensor includes a Hall element, a switch circuit, a voltage/current converter-amplifier, a capacitor as a storage element, a switch and a resistor.
Patent Document 1: Japanese Patent No. 3315397
Patent Document 2: Japanese Patent Laying-Open No. 08-201491